package com.ymttest.database.mapping;

import static org.apache.ibatis.jdbc.SqlBuilder.BEGIN;
import static org.apache.ibatis.jdbc.SqlBuilder.INSERT_INTO;
import static org.apache.ibatis.jdbc.SqlBuilder.SET;
import static org.apache.ibatis.jdbc.SqlBuilder.SQL;
import static org.apache.ibatis.jdbc.SqlBuilder.UPDATE;
import static org.apache.ibatis.jdbc.SqlBuilder.VALUES;
import static org.apache.ibatis.jdbc.SqlBuilder.WHERE;

import com.ymttest.database.model.wxconfig;

public class wxconfigSqlProvider {

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table wxconfig
     *
     * @mbggenerated Tue Mar 31 15:27:38 CST 2020
     */
    public String insertSelective(wxconfig record) {
        BEGIN();
        INSERT_INTO("wxconfig");
        
        if (record.getId() != null) {
            VALUES("Id", "#{id,jdbcType=INTEGER}");
        }
        
        if (record.getAppType() != null) {
            VALUES("AppType", "#{appType,jdbcType=INTEGER}");
        }
        
        if (record.getUserId() != null) {
            VALUES("UserId", "#{userId,jdbcType=INTEGER}");
        }
        
        if (record.getAppId() != null) {
            VALUES("AppId", "#{appId,jdbcType=VARCHAR}");
        }
        
        if (record.getSecret() != null) {
            VALUES("Secret", "#{secret,jdbcType=VARCHAR}");
        }
        
        if (record.getAction() != null) {
            VALUES("Action", "#{action,jdbcType=INTEGER}");
        }
        
        return SQL();
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table wxconfig
     *
     * @mbggenerated Tue Mar 31 15:27:38 CST 2020
     */
    public String updateByPrimaryKeySelective(wxconfig record) {
        BEGIN();
        UPDATE("wxconfig");
        
        if (record.getAppType() != null) {
            SET("AppType = #{appType,jdbcType=INTEGER}");
        }
        
        if (record.getUserId() != null) {
            SET("UserId = #{userId,jdbcType=INTEGER}");
        }
        
        if (record.getAppId() != null) {
            SET("AppId = #{appId,jdbcType=VARCHAR}");
        }
        
        if (record.getSecret() != null) {
            SET("Secret = #{secret,jdbcType=VARCHAR}");
        }
        
        if (record.getAction() != null) {
            SET("Action = #{action,jdbcType=INTEGER}");
        }
        
        WHERE("Id = #{id,jdbcType=INTEGER}");
        
        return SQL();
    }
}